/**
 *  @file
 *  @brief   单元数据基类定义
 *  @author  qiulin
 *  @date    2024.07.23
 *  @version  v1.0
 *  @par Copyright(c):  ShenGong  Simulation corporation
 */

#pragma once
#include <memory>

#include "DataStructure/Common/DataStructureNamespace.h"
#include "DataStructure/Common/Id.h"

SG_DATASTRUCTURE_NAMESPACE_OPEN
/** @brief 单元基类
 *
 * 提供单元计算部分的共有部分
 */
struct SGObject
{
    SGObject () = default;
    SGObject (SG::DataStructure::Common::Id Id);
    // 复制构造
    SGObject (const SGObject& other) = default;

    SG::DataStructure::Common::Id m_id = 0;
};

inline SGObject::SGObject (SG::DataStructure::Common::Id Id) : m_id (Id)
{}

inline bool operator< (const SGObject& SGDataA, const SGObject& SGDataB)
{
    return SGDataA.m_id < SGDataB.m_id;
}

using SGObjectP = std::shared_ptr<SGObject>;

SG_DATASTRUCTURE_NAMESPACE_CLOSE  // end namespace DATASTRUCTURE
